package br.ufrn.cep.eEtica.negocio.rest;

import java.util.List;

import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;

import br.ufrn.cep.eEtica.integracao.model.Revisor;

@Path("/revisor/")
public class RevisorWS extends GenericRS<Revisor>{

	
	/**
	 *  /revisor
	 * 
	 * @param id
	 * @return <Revisor>
	 */
	@Override
	public Revisor getById(@QueryParam("id") int id){
		return getDao().findById(Revisor.class, id);
	}

	/**
	 *  /revisor/listar
	 *  
	 *  @return List<Revisor>
	 */
	@Override
	public List<Revisor> list() {
		return getDao().find(Revisor.class);
	}


	@Override
	public Revisor create(Revisor element) {
		getDao().persist(element);
		return element;
	}

	
	@Override
	public Revisor update(Revisor element) {
		getDao().merge(element);
		return element;
	}
	
	/**
	 *  /revisor/remover
	 * 
	 * @param id
	 */
	@Override
	public void delete(@QueryParam("id")int id) {
		getDao().deleteById(Revisor.class, id);
	}
	
	
}